<template>
    <div>
        <span>{{index}}--{{item.id}}--{{item.name}}--{{item.age}}</span>
        <button @click.prevent="getInfo(item.id)">获取</button>
    </div>
</template>

<script>
    export default {
        name: "List",
        props: [
            "index",
            "item"
        ],
        mounted() {
            console.log(this, this.$parent, this.$root);
        },
        methods: {
            getInfo(id) {
                this.$emit("getIdEvent", id)
            }
        }
    }
</script>

<style scoped>

</style>
